package com.files.service.impl;

import com.files.exception.FileException;
import com.files.model.FileInfo;
import com.files.service.FileValidatorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class FileValidatorServiceImpl implements FileValidatorService {


    @Override
    public void validator(FileInfo fileInfo) {
        if(fileInfo.isEmpty()){
            throw new FileException("Failed to store empty file " + fileInfo.getOriginalFilename());
        }
    }
}
